from research.calcor import calcor_base
from research.calcor.calcor_logic import logic_calc
class countN(calcor_base):
    def __init__(self,logic,timeperiod):#feild
        super().__init__(timeperiod=timeperiod,datatype="selfdata")
        self.logic=logic
    def oncalc(self,b,timekey=None):
        r0 = 0
        r = logic_calc(self.logic, b)
        if r==True:
            r0 = 1
        self.ondata_dim1(r0,timekey)
        rst=sum(self.hisdata)
        return rst
    # def calc(self):
    #     return None

if __name__=="__main__":
    pass